<?php
/*
* Class teia\webdev\php\core\TabDataSource
* Core class for providing tab data
*
* @author Bernardo Quibiana
* @date created: 20111202
*
* @date modified: 20111202
* @modified: Bernardo Quibiana
*/

// namespace declaration: Abstract Data Types
namespace teia\webdev\php\core;

require_once 'ITabDataSource.inc';

class TabDataSource implements ITabDataSource {
	
	private $tab_data;
	
	public function __construct($tab_data) {
		$this->tab_data = $tab_data;
	}
	
	public function get_num_tabs() {
		return count($this->tab_data);
	}
	
	public function get_tabs_name() {
		return array_keys($this->tab_data);
	}
	
	
	public function get_tab_size($tab) {
		return count($this->tab_data[$tab]);
	}
	
	public function get_item_content($it_num, $tab) {
		return null;
	}
	
	public function get_tab_content($tab) {
		return isset($this->tab_data[$tab]) ? $this->tab_data[$tab] : null; 
	}
}
?>